﻿<UserControl x:Class="VH.View.AddCallLogView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:resources="clr-namespace:VH.Resources;assembly=VH.Resources"
             xmlns:controls="clr-namespace:VH.UI.UserControls.Controls;assembly=VH.UI.UserControls"
             xmlns:userControls="clr-namespace:VH.UI.UserControls;assembly=VH.UI.UserControls"
             x:Name="page"
             mc:Ignorable="d">
    <Grid>
        <AdornerDecorator>
            <Grid>
                <ScrollViewer>
                    <Grid Margin="0,10,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <Grid Grid.Row="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="5" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>

                            <Label Content="{x:Static  resources:LabelResources.Name}" />
                            <Grid Grid.Column="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <TextBox
                                    x:Name="txtFirstName"
                                    Margin="8,0,0,0"
                                    Text="{Binding Entity.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                    Width="200" />
                            </Grid>

                            <Label
                                Grid.Row="2"
                                Content="{x:Static  resources:LabelResources.CallDate}" />
                            <Grid
                                Grid.Row="2"
                                Grid.Column="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <DatePicker
                                    Margin="8,0,0,0"
                                    SelectedDate="{Binding Entity.CallDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                    Width="150" />
                                <controls:TimePicker
                                    Margin="4,0,0,0"
                        Grid.Column="1"
                        Width="120"
                        Height="30"
                        PopupHeight="100"
                        HorizontalAlignment="Left"
                        Value="{Binding Entity.CallTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                        TimeInterval="{Binding DataContext.DefaultTimeInterval, ElementName=page}"
                        IsValueReadOnly="True" />
                            </Grid>

                            <Label
                                Grid.Row="4"
                                Content="{x:Static  resources:LabelResources.PhoneNumber}" />
                            <Grid
                                Grid.Row="4"
                                Grid.Column="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <TextBox Grid.Row="4" Grid.Column="1"
                                         Margin="8,0,0,0"
                                         HorizontalAlignment="Left"
                                         Width="180"
                                         userControls:TextBoxMaskBehavior.Mask="Integer"
                                         MaxLength="11"
                                         Text="{Binding Entity.CallContactNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" />
                            </Grid>

                            <Label
                                Grid.Row="6"
                                Content="{x:Static  resources:LabelResources.Comment}" />
                            <Grid
                                Grid.Row="6"
                                Grid.Column="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <TextBox
                                    Margin="8,0,0,0"
                                    Text="{Binding Entity.Comment, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}"
                                    HorizontalAlignment="Left"
                                    Width="300"
                                    TextWrapping="WrapWithOverflow"
                                    AcceptsReturn="True" VerticalContentAlignment="Top" Height="40" />

                            </Grid>
                        </Grid>

                        <Grid
                            HorizontalAlignment="Center"
                            Grid.Row="1">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="10" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Button
                                Content="{x:Static  resources:ButtonResources.Save}"
                                Command="{Binding SaveCommand}" />
                            <Button
                                Content="{x:Static  resources:ButtonResources.Cancel}"
                                Grid.Column="2"
                                Command="{Binding CancelCommand}" />
                        </Grid>
                    </Grid>
                </ScrollViewer>
            </Grid>
        </AdornerDecorator>
    </Grid>
</UserControl>
